package com.osfw.activiti.enums.resource;


import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 流程操作对象
 */
public enum ProcdefNodeObj {

    PERSONNEL("01", "人员"),
    DEPARTMENT("02", "部门");

    private String code;
    private String name;

    ProcdefNodeObj(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }


    public static ProcdefNodeObj getProcdefNodeObj(String code) {
        for (ProcdefNodeObj objEnum : values()) {
            if (objEnum.getCode().equals(code)) {
                return objEnum;
            }
        }
        return null;
    }

    public static Map<String, String> getProcdefNodeObjList() {
        HashMap<String, String> map = new LinkedHashMap<>();
        for (ProcdefNodeObj objEnum : values()) {
            map.put(objEnum.getCode(), objEnum.getName());
        }
        return map;
    }

}
